//
//  DownloadCell.m
//  DownloadDemo
//
//  Created by lanou3g on 16/4/27.
//  Copyright © 2016年 鸥！陈凯. All rights reserved.
//

#import "DownloadCell.h"
#import "DownloadManager.h"
@interface DownloadCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIProgressView *progressView;

@property (weak, nonatomic) IBOutlet UILabel *progressLabel;

@end
@implementation DownloadCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)layoutSubviews {
    self.titleLabel.text = [[DownloadManager shareManager] getTitleWithIndex:self.indexPath.row];
  [[DownloadManager shareManager] setProgressBlock:^(float progress) {
      self.progressView.progress = progress;
      self.progressLabel.text = [NSString stringWithFormat:@"进度:%.2f %%",progress * 100];
  } CompleteBlock:^(NSString *path) {
      
  } Index:self.indexPath.row];
}
@end
